import request from "@/utils/request.js";
import useRsaStore from "@/store/modules/RsaStore.js"
import {elMessageTip} from "@/utils/MessageTipUtils.js";
import {resolvePromise_status} from "@/utils/ReturnUtils.js";

/**
 * 获取通用的 RSA 公钥
 */
export function getRsaPublicKeyAPI() {
    return request.get('/rsa/public').then(
        res => {
            // elMessageTip(res)
            // 保存 rsa 公钥
            useRsaStore().saveKeyPair(res.data)
            return resolvePromise_status(res)
        }
    )
}